﻿using ECommon.Components;
using ESTAR.Infrastructure;
using ESTAR.QueryServices.UserQueryServices;
using System.Linq;
using User.Model;
using User.Model.Models;

namespace User.QueryServices.EFCore
{
    [Component]
    public class UserQueryServices : QueryServicesCore<UserInfoModel>, IUserQueryServices
    {
        public UserQueryServices(UserDbContext DbContext) : base(DbContext)
        {

        }

        public string GetUserName(string Id)
        {
            var user = QueryNoTracking().Where(n => n.Id == Id).FirstOrDefault();
            return user?.UserName;
        }
    }
}
